import http from "@/api";
import qs from "qs";

/**
 * @name 首页模块
 */

// 指派给我的请求
export const findRequest = params => {
  return http.post(`/pages/request!findRequests.action`, qs.stringify(params), { loading: false });
};

// 我待处理的任务
export const findPagePersonalTasks = params => {
  return http.post(`/pages/jbpm!findPagePersonalTasks.action`, qs.stringify(params), { loading: false });
};

// 热门知识
export const findPopularKnowledge = params => {
  return http.post(`/pages/knowledgeInfo1!findPopularKnowledge.action`, qs.stringify(params), { loading: false });
};

// 知识列表
export const findAllKnowledges = params => {
  return http.post(`/pages/clientknowledge!findAllKnowledges.action`, qs.stringify(params), { loading: false });
};

// 知识详情
export const showKnowledge = params => {
  return http.post(`/pages/clientknowledge!showKnowledge.action`, qs.stringify(params), { loading: false });
};

// 知识评价列表
export const findByIdCommentKnowledge = params => {
  return http.post(`/pages/knowledgeInfo!findByIdCommentKnowledge.action`, qs.stringify(params), { loading: false });
};

// 知识库统计
export const countKnowledge = params => {
  return http.post(`/pages/clientknowledge!countKnowledge.action`, qs.stringify(params), { loading: false });
};

// 发表评价
export const saveCommentKnowledge = params => {
  return http.post(`/pages/knowledgeInfo!saveCommentKnowledge.action`, qs.stringify(params), { loading: false });
};

// 请求统计
export const countRequest = params => {
  return http.post(`/pages/clientRequest!countRequest.action`, qs.stringify(params), { loading: false });
};

// 公告栏
export const afficheList = params => {
  return http.post(`/pages/affiche!find.action`, qs.stringify(params), { loading: false });
};

// 流程任务统计
export const countRequestFlowTask = params => {
  return http.post(`/pages/request!countRequestFlowTask.action`, qs.stringify(params), { loading: false });
};

// 工单解决情况
export const findStatusCount = params => {
  return http.post(`/pages/request!findStatusCount.action`, qs.stringify(params), { loading: false });
};

// 工单分配情况
export const findServicesOrgNameCount = params => {
  return http.post(`/pages/request!findservicesOrgNameCount.action`, qs.stringify(params), { loading: false });
};

// 年度工单
export const findYearCreateRequest = params => {
  return http.post(`/pages/request!findYearCreateRequest.action`, qs.stringify(params), { loading: false });
};

// 月度工单
export const findMonthCreateRequest = params => {
  return http.post(`/pages/request!findMonthCreateRequest.action`, qs.stringify(params), { loading: false });
};

// 周度工单
export const findWeekCreateRequest = params => {
  return http.post(`/pages/request!findWeekCreateRequest.action`, qs.stringify(params), { loading: false });
};

// 今日工单
export const findNowCreateRequest = params => {
  return http.post(`/pages/request!findNowCreateRequest.action`, qs.stringify(params), { loading: false });
};

// 新增工单
export const findbenri = params => {
  return http.post(`/pages/request!findbenri.action`, qs.stringify(params), { loading: false });
};

// 工单分类
export const findAllCategoryNoCount = params => {
  return http.post(`/pages/request!findAllCategoryNoCount.action`, qs.stringify(params), { loading: false });
};

// 技术员SLA按时完成率
export const findmonth = params => {
  return http.post(`/pages/request!findmonth.action`, qs.stringify(params), { loading: false });
};

// 技术员工作量
export const findStartToOverTimeTechnician = params => {
  return http.post(`/pages/request!findStartToOverTimeTechnician.action`, qs.stringify(params), { loading: false });
};

// 部门故障分布
export const findOrgNameCount = params => {
  return http.post(`/pages/request!findOrgNameCount.action`, qs.stringify(params), { loading: false });
};

// 发布详细
export const releaseDetails = params => {
  return http.post(`/pages/clientRelease!releaseDetails.action`, qs.stringify(params), { loading: false });
};

// 获取弹窗token
export const getPpbxToken = () => {
  return http.post(`/pages/ppbxToken!getPpbxToken.action`, qs.stringify({}), { loading: false });
};
// 创建录音记录
export const createLYRequest = () => {
  return http.post(`ppbxInfo!createLYRequest.action`, qs.stringify({}), { loading: false });
};
// 查询用户通过用户名
export const findUserByNumber = params => {
  return http.post(`/pages/user!findUserByNumber.action?userQueryDto.mobilePhone=` + params, qs.stringify({}), {
    loading: false
  });
};
